//
//  HRComposeButton.swift
//  weiBo
//
//  Created by helong on 16/7/17.
//  Copyright © 2016年 helong. All rights reserved.
//

import UIKit
/// 微博compose页面的自定义按钮
class HRComposeButton: UIButton {
    //  按钮持有模型
    var composeModel: HRCompose?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    private func setupUI(){
        
        titleLabel?.textAlignment = .Center
//        self.frame.size = CGSize(width: 80, height: 110)
//        titleLabel?.textColor = UIColor.blackColor()
        setTitleColor(UIColor.darkGrayColor(), forState: .Normal)
        titleLabel?.font = UIFont.systemFontOfSize(16)
        
        

    }
     // MARK: - 重新布局子控件
    override func layoutSubviews() {
        super.layoutSubviews()
        //  布局大小
        imageView?.width = self.width
        imageView?.height = self.width
        titleLabel?.width = self.width
        titleLabel?.height = self.height - self.width
        //  布局坐标
        imageView?.y = 0
        titleLabel?.x = 0
        titleLabel?.y = (self.imageView?.height)!
    }
     // MARK: - 重写按钮的高亮属性
    override var highlighted: Bool {
        get{
            return false
        }set{
            
        }
    }
}
